package com.cen.cloud.service;

import com.cen.cloud.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * @Author cen
 * @Date 2020/10/4 21:35
 */
@Component
@FeignClient(value = "CLOUD-PROVIDER-DEPT",fallbackFactory = DeptClientServiceFallbackFactory.class)
public interface DeptClientService {
    @PostMapping("/dept/add")
    public boolean addDept(Dept dept);
    @GetMapping("/dept/get")
    List<Dept> getAll();

    @GetMapping("/dept/getByID/{id}")
    public Dept getByID(@PathVariable("id") Long deptno);
}
